#ifndef TANKGAME_CALCULATION_H_
#define TANKGAME_CALCULATION_H_

#include <cstdio>
#include <iostream>
#include <algorithm>
#include <map>
#include <set>
#include <vector>
#include <cstring>
#include <string>

namespace CMInterfaceStruct {
// map
struct Map {
    int width;
    int height;
    std::vector<std::vector<char>> coordinate_type;
};

// tank
struct Tank {
    int atk;
    int def;
    int height;
    int hp;
    std::string moving_direct;
    std::string tank_id;
    int width;
    int x;
    int y;
};

// bullet
struct Bullet {
    std::string bullet_id;
    int height;
    std::string moving_direct;
    std::string tank_id;
    int width;
    int x;
    int y;
};

// prop
struct Prop {
    int height;
    std::string prop_type_enums;
    int width;
    int x;
    int y;
};

// safe area
struct SafeArea {
    int left_time;
    int r;
    int x;
    int y;
};

// action
struct Action{
    std::string moving_direct;
    bool fire;
};
};

class Calculation {
public:
    static Calculation& GetInstance();
    bool Initialize();
    CMInterfaceStruct::Action Start(
        const CMInterfaceStruct::Map& m, 
        const std::vector<CMInterfaceStruct::Tank> &tank_list,
        const std::vector<CMInterfaceStruct::Bullet> &bullet_list,
        const std::vector<CMInterfaceStruct::Prop> &prop_list,
        const CMInterfaceStruct::SafeArea &safe_area
    );

    void Print();
private:
    Calculation();
    ~Calculation();

    Calculation(const Calculation &ca);
    const Calculation &operator=(const Calculation &ca);
};

#endif